import 'package:flutter/material.dart';
import 'package:get/get.dart';

class HomeController extends GetxController {
  PageController? pageController;
  int pageIndex = 0;

  @override
  void onInit() {
    super.onInit();
  }

  @override
  void onReady() {
    super.onReady();
  }

  @override
  void onClose() {
    pageController!.dispose();
  }

  void navigationTapped(int page) {
    pageController!.jumpToPage(page);
  }

  void onPageChanged(int index) {
    pageIndex = index;
    update();
  }

  void initPageController() {
    pageController = PageController(initialPage: pageIndex);
  }
}
